package com.knife.blog.logic;

import java.io.InputStream;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.ResourceBundle;

public class SysConfig {
	private static SysConfig config = new SysConfig();
	private Map sysConfig = new HashMap();
	
	private SysConfig(){
		init();
	}
	
	public static SysConfig getInstance(){
		return config;
	}
	
	private void init(){
     	ResourceBundle bundle=null;
        try {
             bundle = ResourceBundle.getBundle("SysConfig");
		for(Enumeration keys = bundle.getKeys();keys.hasMoreElements();){
			String bundleKey = (String)keys.nextElement();
			String key = bundleKey.substring(bundleKey.lastIndexOf(".")+1, bundleKey.length());
			sysConfig.put(key, bundle.getString(bundleKey));
		}
        }catch(Exception e){
            e.printStackTrace();
        }
		
	}

	public Map getSysConfig() {
		return sysConfig;
	}

	/*public void setSysConfig(Map sysConfig) {
		this.sysConfig = sysConfig;
	}*/

}
